<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="https://s3.pstatp.com/cdn/expire-1-M/jquery/3.3.1/jquery.min.js"></script>
	</head>
	<!-- 操作（action，可以是：点击：click，收藏：job_collect，投简历：cv_send，上传简历：cv_upload） -->
	<body>
		<div>
			<p>阿里</p>
			<button onclick="action('alibaba','click')">点击</button>
			<button onclick="action('alibaba','job_collect')">收藏</button>
			<button onclick="action('alibaba','cv_send')">投简历</button>
			<button onclick="action('alibaba','cv_upload')">上传简历</button>
		</div>
		
		<div>
			<p>百度</p>
			<button onclick="action('baidu','click')">点击</button>
			<button onclick="action('baidu','job_collect')">收藏</button>
			<button onclick="action('baidu','cv_send')">投简历</button>
			<button onclick="action('baidu','cv_upload')">上传简历</button>
		</div>
		
	</body>
	
</html>

<script type="text/javascript">
	
	localStorage.setItem("userId","123");
	
	function action(jobCode,actionType){
		let userId = localStorage.getItem("userId");
		
		//console.log(userId+"=="+jobCode+"=="+new Date().getTime()+"=="+actionType)

		$.ajax({
				url: 'http://page.kinson.com/nginx/log',
				type: 'POST',
				contentType: 'application/json;charset=utf-8',
				dataType: 'json',
				data:{
				  user_id:userId,
				  job_code:jobCode,
				  action:actionType,
				  act_time:  new Date().getTime()
				},
				success: function (data) {

				}
			})
	}
</script>
